package com.woniuxy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.entity.DishCategory;
import com.woniuxy.mapper.DishCategoryMapper;
import com.woniuxy.service.DishCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DishCategoryServiceImpl extends ServiceImpl<DishCategoryMapper, DishCategory> implements DishCategoryService {
    @Autowired
    private DishCategoryMapper dishCategoryMapper;
    @Override
    public List<DishCategory> getAll(){
        return dishCategoryMapper.getAll();
    }

    @Override
    public void update(DishCategory dishCategory){
        dishCategoryMapper.update(dishCategory);
    }

    @Override
    public List<DishCategory> getByCondition(DishCategory dishCategory){
        return dishCategoryMapper.getByCondition(dishCategory);
    }

    @Override
    public void delById(int id){
        dishCategoryMapper.deleteById(id);
    }

    @Override
    public DishCategory getByName(String name){
        return dishCategoryMapper.getByName(name);
    }
}
